<template>
	<view>
		<view v-for="item in indoData.list" :key="item.id" v-if="item.object">
			<uni-list>
				<uni-list-item :border="false" :title="item.sender.name+item.action_name+'了你的互动'" :note="item.create_time" :thumb="item.sender.head_img" thumb-size="lg" />
				<uni-list-item class="content" :border="false" :title="item.object.title" :note="'点赞：'+item.object.likes_num+';收藏：'+item.object.collect_num+';评论：'+item.object.reply_num" />
			</uni-list>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				form:{page: 1},
				indoData:{list:[],count:0,num:10,page:1},
			}
		},
		onShow() {
			this.onGetData()
		},
		methods: {
			onGetData(){
				let _this = this
				this.$request('/api2/notify_liked','POST',_this.form).then(res => {
					res.data.list.forEach((e) => {
						e.action_name = ''
						if(e.action == 'like'){
							e.action_name = '赞'
						}
						if(e.action == 'collected'){
							e.action_name = '收藏'
						}
					})
					_this.indoData = res.data
					
				}).catch(err => {
					console.log(err)
				})
			},
		}
	}
</script>

<style>
.content{padding-left: 60px;}
</style>
